﻿<%@ Page Title="::Promotion App::" Language="C#" MasterPageFile="~/masterpage/LoginSite.Master" AutoEventWireup="true" CodeBehind="UserManagement.aspx.cs" Inherits="UserManagement" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:HiddenField ID="hdnUserID" runat="server" />
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="display:none"> 
<fieldset>
<legend><font>ค้นหาผู้ใช้งาน</font></legend>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>ชื่อผู้ใช้งาน :</td>
<td colspan="3" align="left">
    <asp:TextBox ID="txtPromotionName" runat="server" Width="398px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Start :</td>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
    <asp:TextBox ID="txtSartDate" runat="server"></asp:TextBox>
</td>
<td>
    <asp:Button ID="Button1" runat="server" Text="Button" />
    </td>
</tr>
</table>
</td>
<td>End :</td>
<td><table cellpadding="0" cellspacing="0">
<tr>
<td>
    <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
</td>
<td>
    <asp:Button ID="Button2" runat="server" Text="Button" />
    </td>
</tr>
</table></td>
</tr>
<tr>
                        <td colspan="4" align="center" style="height:40px">
                            <asp:Button runat="server" Width="80px" ID="btnSearch" Text="ค้นหา" />
                            <asp:Button runat="server" Width="80px" ID="btnClear" Text="ล้างข้อมูล" />
                        </td>
                    </tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
    จัดการผู้ใช้งาน</td>
<td align="right">
<asp:Button ID="btnAdd" runat="server" Text="เพิ่มข้อมูลผู้ใช้งาน" 
        onclick="btnAdd_Click" />
</td> 
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><br />
    <asp:GridView ID="grdUserManagement" runat="server" AutoGenerateColumns="False" 
        onrowcommand="grdUserManagement_RowCommand" 
        onrowdatabound="grdUserManagement_RowDataBound">
        <Columns>
            <asp:TemplateField HeaderText="ลำดับ">
                <ItemTemplate>
                    <asp:Label ID="lblNo" runat="server"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="รหัสผู้ใช้">
                <ItemTemplate>
                    <asp:Label ID="lblUserID" runat="server" Text='<% #Bind("User_ID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="ชื่อ">
                <ItemTemplate>
                    <asp:Label ID="lblName" runat="server" Text='<% #Bind("User_FirstName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="สกุล">
                   <ItemTemplate>
                    <asp:Label ID="lblLastname" runat="server" Text='<% #Bind("User_LastName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Email Address">
            <ItemTemplate>
                    <asp:Label ID="lblEmail" runat="server" Text='<% #Bind("User_Email") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="หมายเลขโทรศัพท์">
                <ItemTemplate>
                    <asp:Label ID="lblTelNo" runat="server" Text='<% #Bind("User_TelNo") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="ประเภทผู้ใช้">
                <ItemTemplate>
                    <asp:Label ID="lblUserType" runat="server" Text='<% #Bind("UserType_Name") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="สถานะผู้ใช้งาน">
                <ItemTemplate>
                    <asp:Label ID="lblStatus" runat="server" Text='<% #Bind("User_Status") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Detail">
                <ItemTemplate>
                    <asp:ImageButton ID="btnPromotionView" runat="server" ImageUrl="../images/icon/ico559.gif" AlternateText="View" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Edit">
                <ItemTemplate>
                    <asp:ImageButton ID="btnPromotionEdit" runat="server" ImageUrl="../images/icon/ico425.gif" AlternateText="Edit" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:ImageButton ID="btnPromotionDelete" runat="server" ImageUrl="../images/icon/ico417.gif" AlternateText="Delete" CommandName="Del" CommandArgument='<%# Eval("User_ID") %>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</td>
</tr>
<tr>
<td align="center"> <asp:Label ID="lblMessage" runat="server"></asp:Label></td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Content>
